from comment.models import db
from datetime import datetime


# 用户模型类
class User(db.Model):
    __tablename__ = 't_User'
    id = db.Column(db.BIGINT, primary_key=True, autoincrement=True)
    user_name = db.Column(db.String(64), doc='用户名')
    password = db.Column(db.String(64), doc='密码')
    phone = db.Column(db.String(11), doc='手机号')
    # 头像
    icon = db.Column(db.String(5000), doc='用户头像地址')
    email = db.Column(db.String(100), doc='邮箱')
    nick_name = db.Column(db.String(200), doc='昵称')
    note = db.Column(db.String(500), doc='备注')
    # default=datetime.now() 默认时间取当前时间
    login_time = db.Column(db.DATETIME, default=datetime.now(), doc='登录时间')
    create_time = db.Column(db.DATETIME, default=datetime.now(), doc='创建时间')
    update_time = db.Column(db.DATETIME, default=datetime.now(), onupdate=datetime.now(), doc='修改时间')
    # 用户状态
    status = db.Column(db.INTEGER,doc='用户状态')
